/*
 	AllPurpose.h

 	Copyright (c) 2008 Bojan Rajkovic

 	Permission is hereby granted, free of charge, to any person obtaining a copy
 	of this software and associated documentation files (the "Software"), to deal
		in the Software without restriction, including without limitation the rights
 	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 	copies of the Software, and to permit persons to whom the Software is
 	furnished to do so, subject to the following conditions:
	
 	The above copyright notice and this permission notice shall be included in
 	all copies or substantial portions of the Software.

 	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 	THE SOFTWARE.
*/

// This is an all purpose header that holds all the necessary includes.

#pragma once /* we only want it once anyway */

#include <fstream>
#include <sstream>
#include <stdio.h>
#include <libconfig.h++>
#include <errno.h>
#include <string.h>
#include <pcrecpp.h>
#include <iostream>

// various defines to set up defaults for configuration options
#define DEFAULT_INPUT_DEVICE "/dev/input/event0"
#define DEFAULT_OUTPUT_FILE "/var/keycounter"
#define DEFAULT_DB_LOCATION "/var/lib/keycounter/pulse.db"
#define DEFAULT_CONFIG_FILE "/etc/keycounter.conf"
#define LOCALEDIR "/usr/share/keycounter/locale/"
#define SOCK_PATH "/var/lib/keycounter/ctrl"

// some other useful defines
#define M_ERROR 1
#define M_INFO 2
#define KEYCOUNTER_VERSION "0.6"

// headers for l10n and i18n with GNU gettext
#include <libintl.h>
#define _(string) gettext (string)
#include "autosprintf.h"
#define gettext_noop(String) String
#define N_(String) gettext_noop (String)

// a slightly customized FREE macro that also sets pointers to null
#define FREE(Pointer) free(Pointer); Pointer = NULL;

// pull in the used namespaces
using namespace std;
using namespace libconfig;
